﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;

namespace PJRScrum
{
    public class Punt
    {
        double x;
        double y;
        double ak;
        double bk;
        double c;

        public Punt(double x, double y)
        {
            this.x = x;
            this.y = y;
        }

        public Punt()
        {
        }

        public void setCoords(double x, double y)
        {
            this.x = x;
            this.y = y;
        }

        public bool Check(Point pMuis)
        {
            return Check(pMuis, new Point((int)x, (int)y));
        }

        const int DEFAULT_RADIUS = 5;
        public static bool Check(Point p1, Point p2)
        {
            return Check(p1, p2, DEFAULT_RADIUS);
        }

        public static bool Check(Point p1, Point p2, int radius)
        {
            double c = distBetween(p1, p2);

            return c < radius;
        }

        public static double distBetween(Point p1, Point p2)
        {
            double ak = ((p1.X - p2.X) * (p1.X - p2.X));
            double bk = ((p1.Y - p2.Y) * (p1.Y - p2.Y));
            return Math.Sqrt(ak + bk);
        }

        
        public double X
        {
            get { return x; }
            set { x = value; }
        }

        public double Y
        {
            get { return y; }
            set { y = value; }
        }
    }
}
